$OpenBSD: patch-doc_mkcert_sh,v 1.7 2010/03/23 21:32:07 pea Exp $
--- doc/mkcert.sh.orig	Wed Jan  7 13:33:25 2009
+++ doc/mkcert.sh	Sun Dec 27 01:03:53 2009
@@ -5,19 +5,13 @@
 
 OPENSSL=${OPENSSL-openssl}
 SSLDIR=${SSLDIR-/etc/ssl}
-OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}
+OPENSSLCONFIG=${OPENSSLCONFIG-${SSLDIR}/dovecot-openssl.cnf}
 
-CERTDIR=$SSLDIR/certs
 KEYDIR=$SSLDIR/private
 
-CERTFILE=$CERTDIR/dovecot.pem
+CERTFILE=$SSLDIR/dovecotcert.pem
 KEYFILE=$KEYDIR/dovecot.pem
 
-if [ ! -d $CERTDIR ]; then
-  echo "$SSLDIR/certs directory doesn't exist"
-  exit 1
-fi
-
 if [ ! -d $KEYDIR ]; then
   echo "$SSLDIR/private directory doesn't exist"
   exit 1
@@ -33,7 +27,7 @@ if [ -f $KEYFILE ]; then
   exit 1
 fi
 
-$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 365 || exit 2
+$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 730 || exit 2
 chmod 0600 $KEYFILE
 echo 
 $OPENSSL x509 -subject -fingerprint -noout -in $CERTFILE || exit 2
